import pandas as pd
import numpy as np

df = pd.DataFrame(np.arange(12).reshape((3,4)),index=list("XYZ"),columns=list("abcd"),dtype="float")
print(df)

df.loc["X","c"] = np.nan
df.iloc[1,3] = np.nan
print(df)

#输出是否是nan
# print(df.isnull())

# print(df[pd.notnull(df["c"])])

#删除有nan的行
# print(df.dropna(axis=0))

#用100来替换nan
print(df.fillna(100))

